<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>javascript高级程序设计</title>
</head>
<body>
  <h2>Code Examples</h2>
  <script>
    /*
     * 严格模式下未声明的变量赋值报错
     */
    'use strict';
    // msg = 'hahaha';
    // console.log(msg);

    /*
     * typeof的使用
     */ 
    var a = 'abc',
        b = 123,
        c = true,
        d = undefined,
        e = null,
        f = {name: 'fang'},
        g = function() { return 123 };
    console.log(
      typeof a,
      typeof b,
      typeof c,
      typeof d,
      typeof e,
      typeof f,
      typeof g
    );

    var result;
    console.log ( typeof(result) );

    /*
     * null的使用
     */ 
    var a = null; //对变量a进行初始化；
    if (a === null) {
      a = { name: 'fang', age: 26 }
    }
    console.log(a);

    /*
     * number类型的
     */ 
    // var num = 079; //八进制的数字
    // console.log(num);
  </script>
</body>
</html>